/*
 * @Date: 2022-02-13 14:09:26
 * @LastEditors: xiaole
 * @LastEditTime: 2022-02-13 20:51:04
 */

import { defineComponent ,ref,inject} from "vue";
import './editor-block.scss'

export default defineComponent({
    props: {
        block: {
            type: Object
        }
    },
    setup(props) {
        const containerRef = ref(null)

        const config = inject('config')
        return () =>{
            const component = config.componentMap[props.block.key]
            const RenderComponent = component.render()
            return <div class="editor-center-item" ref={containerRef}>
                {RenderComponent}
            </div>
        } 
    }
})